rustup
authorRobin Gloster <robin@loc-com.de>
Sun, 22 Feb 2015 23:06:12 +0000 (00:06 +0100)
committerRobin Gloster <robin@loc-com.de>
Tue, 24 Feb 2015 11:43:41 +0000 (12:43 +0100)
29 files changed:
Cargo.lock
src/bin/cargo.rs
src/cargo/core/manifest.rs
src/cargo/core/package.rs
src/cargo/core/package_id.rs
src/cargo/core/resolver/mod.rs
src/cargo/core/source.rs
src/cargo/lib.rs
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_new.rs
src/cargo/ops/cargo_rustc/compilation.rs
src/cargo/ops/cargo_rustc/context.rs
src/cargo/ops/cargo_rustc/custom_build.rs
src/cargo/ops/cargo_rustc/fingerprint.rs
src/cargo/ops/cargo_rustc/job.rs
src/cargo/ops/cargo_rustc/job_queue.rs
src/cargo/ops/cargo_rustc/mod.rs
src/cargo/sources/path.rs
src/cargo/util/dependency_queue.rs
src/cargo/util/errors.rs
src/cargo/util/graph.rs
src/cargo/util/hex.rs
src/cargo/util/lev_distance.rs
src/cargo/util/process_builder.rs
src/rustversion.txt
tests/support/mod.rs
tests/test_cargo_build_auth.rs
tests/test_cargo_compile_git_deps.rs
tests/tests.rs

index 629585c5d99f02256b8aaa4a403c4725abf1fdd9..86081587174120001326ce53f4b21acde0d1156d 100644 (file)
@@ -3,25 +3,25 @@ name = "cargo"
 version = "0.1.0"
 dependencies = [
  "advapi32-sys 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "curl 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "docopt 0.6.37 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "docopt 0.6.39 (registry+https://github.com/rust-lang/crates.io-index)",
  "env_logger 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "flate2 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "git2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "git2 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
  "git2-curl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "glob 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git)",
- "log 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
  "registry 0.1.0",
- "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "semver 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "tar 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "term 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "semver 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tar 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "term 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
  "toml 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -29,7 +29,7 @@ name = "advapi32-sys"
 version = "0.0.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "winapi 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -39,33 +39,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "curl"
-version = "0.1.14"
+version = "0.1.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "curl-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "curl-sys"
-version = "0.1.8"
+version = "0.1.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libz-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "docopt"
-version = "0.6.37"
+version = "0.6.39"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -73,8 +73,8 @@ name = "env_logger"
 version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "log 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -91,14 +91,19 @@ name = "gcc"
 version = "0.1.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "gcc"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
 [[package]]
 name = "git2"
-version = "0.1.17"
+version = "0.1.20"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -106,9 +111,9 @@ name = "git2-curl"
 version = "0.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "curl 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "git2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "git2 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -119,14 +124,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 [[package]]
 name = "hamcrest"
 version = "0.1.0"
-source = "git+https://github.com/carllerche/hamcrest-rust.git#70d572f27ebbffb5a8d67ed2c890241d6d82d0a3"
+source = "git+https://github.com/carllerche/hamcrest-rust.git#af4418fea7d8cdba6469d43ff45a50dd5f7ad357"
 
 [[package]]
 name = "kernel32-sys"
-version = "0.0.7"
+version = "0.0.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "winapi 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -136,13 +141,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "libgit2-sys"
-version = "0.1.13"
+version = "0.1.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libssh2-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libssh2-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libz-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -155,25 +160,26 @@ dependencies = [
 
 [[package]]
 name = "libssh2-sys"
-version = "0.1.5"
+version = "0.1.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libz-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "libz-sys"
-version = "0.1.0"
+version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "log"
-version = "0.2.3"
+version = "0.2.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -192,12 +198,12 @@ dependencies = [
 
 [[package]]
 name = "openssl-sys"
-version = "0.3.6"
+version = "0.4.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -207,7 +213,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "pkg-config"
-version = "0.2.1"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "pkg-config"
+version = "0.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -217,40 +228,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "regex"
-version = "0.1.14"
+version = "0.1.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "registry"
 version = "0.1.0"
 dependencies = [
- "curl 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "rustc-serialize"
-version = "0.2.12"
+version = "0.2.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "semver"
-version = "0.1.14"
+version = "0.1.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "tar"
-version = "0.1.10"
+version = "0.1.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "term"
-version = "0.1.11"
+version = "0.1.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "kernel32-sys 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "kernel32-sys 0.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -267,21 +278,21 @@ name = "toml"
 version = "0.1.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "url"
-version = "0.2.20"
+version = "0.2.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "winapi"
-version = "0.1.11"
+version = "0.1.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
index b69459da71e750fd2fb5de67d4ec57ed3b3a5761..ff74918518f61fcf79d70824df20d09636b29176 100644 (file)
@@ -1,4 +1,4 @@
-#![feature(collections, core, io, path, env)]
+#![feature(collections, core, old_io, old_path, env)]
 
 extern crate "git2-curl" as git2_curl;
 extern crate "rustc-serialize" as rustc_serialize;
@@ -99,7 +99,7 @@ fn execute(flags: Flags, config: &Config) -> CliResult<Option<()>> {
         return Ok(None)
     }
 
-    let (mut args, command) = match &flags.arg_command[] {
+    let (mut args, command) = match &flags.arg_command[..] {
         "" | "help" if flags.arg_args.len() == 0 => {
             config.shell().set_verbose(true);
             let args = &["foo".to_string(), "-h".to_string()];
@@ -111,7 +111,7 @@ fn execute(flags: Flags, config: &Config) -> CliResult<Option<()>> {
         "help" if flags.arg_args[0] == "-h" ||
                   flags.arg_args[0] == "--help" =>
             (flags.arg_args, "help"),
-        "help" => (vec!["-h".to_string()], &flags.arg_args[0][]),
+        "help" => (vec!["-h".to_string()], &flags.arg_args[0][..]),
         s => (flags.arg_args.clone(), s),
     };
     args.insert(0, command.to_string());
index 05ba153ff4473925250e8d0ba2a3dd4bcf928a57..f942a2471163be29652f51ab5bdcbb5817e33f51 100644 (file)
@@ -273,8 +273,8 @@ impl Profile {
     }
 }
 
-impl<H: hash::Writer + hash::Hasher> hash::Hash<H> for Profile {
-    fn hash(&self, into: &mut H) {
+impl hash::Hash for Profile {
+    fn hash<H: hash::Hasher>(&self, into: &mut H) {
         // Be sure to match all fields explicitly, but ignore those not relevant
         // to the actual hash of a profile.
         let Profile {
index 02e9d91ddb5b8ed69dfa160f6f8bb2c3d0ee360d..58e7415b6ae888034c2b2cf4be5b80fb12e0f4bd 100644 (file)
@@ -102,8 +102,8 @@ impl PartialEq for Package {
 
 impl Eq for Package {}
 
-impl<H: hash::Writer + hash::Hasher> hash::Hash<H> for Package {
-    fn hash(&self, into: &mut H) {
+impl hash::Hash for Package {
+    fn hash<H: hash::Hasher>(&self, into: &mut H) {
         self.package_id().hash(into)
     }
 }
index 28eeb33a4ae7f173820e7a325452f4b516fb9e28..336ee96ecefc4858eb8f36ee7dc8599e93492b0d 100644 (file)
@@ -1,7 +1,7 @@
 use std::cmp::Ordering;
 use std::error::{Error, FromError};
 use std::fmt::{self, Formatter};
-use std::hash::{Hash, SipHasher};
+use std::hash::Hash;
 use std::hash;
 use std::sync::Arc;
 
@@ -56,8 +56,8 @@ impl Decodable for PackageId {
     }
 }
 
-impl<S: hash::Writer + hash::Hasher> Hash<S> for PackageId {
-    fn hash(&self, state: &mut S) {
+impl Hash for PackageId {
+    fn hash<S: hash::Hasher>(&self, state: &mut S) {
         self.inner.name.hash(state);
         self.inner.version.to_string().hash(state);
         self.inner.source_id.hash(state);
@@ -156,7 +156,7 @@ impl PackageId {
 }
 
 impl Metadata {
-    pub fn mix<T: Hash<SipHasher>>(&mut self, t: &T) {
+    pub fn mix<T: Hash>(&mut self, t: &T) {
         let new_metadata = short_hash(&(&self.metadata, t));
         self.extra_filename = format!("-{}", new_metadata);
         self.metadata = new_metadata;
index cc5d5b36162a73b0e2ed1229e4f096b92da3f5cc..3bd5cf6c1a19ddd493829b9ab964106a1108e6b6 100644 (file)
@@ -316,7 +316,7 @@ fn activate_deps<'a>(cx: Box<Context>,
     // Oh well, we couldn't activate any of the candidates, so we just can't
     // activate this dependency at all
     Ok(activation_error(&cx, registry, last_err, parent, dep, prev_active,
-                        &candidates[]))
+                        &candidates))
 }
 
 fn activation_error(cx: &Context,
@@ -360,7 +360,7 @@ fn activation_error(cx: &Context,
                                         .map(|v| v.version())
                                         .map(|v| v.to_string())
                                         .collect::<Vec<_>>()
-                                        .connect(", "))[]);
+                                        .connect(", ")));
 
         return Err(human(msg))
     }
index c73eb3a0766ca13d007e01cbe08deccea741c853..a9cf3bd08b4f593670f94ed28a1c971562a06944 100644 (file)
@@ -316,8 +316,8 @@ impl PartialEq for SourceIdInner {
     }
 }
 
-impl<S: hash::Writer + hash::Hasher> hash::Hash<S> for SourceId {
-    fn hash(&self, into: &mut S) {
+impl hash::Hash for SourceId {
+    fn hash<S: hash::Hasher>(&self, into: &mut S) {
         self.inner.kind.hash(into);
         match *self.inner {
             SourceIdInner { kind: Kind::Git(..), ref url, .. } => {
index 249ded37c9627ddf2fdbd7413d73e80291a4ef71..ad0e7b59a2677d9a539480d0c21e4cc4502e877d 100644 (file)
@@ -1,6 +1,6 @@
 #![deny(unused)]
-#![feature(collections, hash, io, libc, os, path, std_misc, unicode, env, core)]
-#![cfg_attr(test, deny(warnings))]
+#![feature(collections, hash, libc, os, std_misc, unicode, env, core)]
+#![feature(old_io, old_path, str_words)]
 
 extern crate libc;
 extern crate "rustc-serialize" as rustc_serialize;
index 5ba207498cda13252e14851c4e1bcee3e866ed7a..37a5f0993ec29d8165b1b67a86f12c0ce9000e9a 100644 (file)
@@ -215,7 +215,7 @@ fn scrape_build_config(config: &Config,
     };
     base.host = try!(scrape_target_config(config, config.rustc_host()));
     base.target = match target.as_ref() {
-        Some(triple) => try!(scrape_target_config(config, &triple[])),
+        Some(triple) => try!(scrape_target_config(config, &triple)),
         None => base.host.clone(),
     };
     Ok(base)
@@ -224,15 +224,15 @@ fn scrape_build_config(config: &Config,
 fn scrape_target_config(config: &Config, triple: &str)
                         -> CargoResult<ops::TargetConfig> {
     let key = format!("target.{}", triple);
-    let ar = try!(config.get_string(&format!("{}.ar", key)[]));
-    let linker = try!(config.get_string(&format!("{}.linker", key)[]));
+    let ar = try!(config.get_string(&format!("{}.ar", key)));
+    let linker = try!(config.get_string(&format!("{}.linker", key)));
 
     let mut ret = ops::TargetConfig {
         ar: ar.map(|p| p.0),
         linker: linker.map(|p| p.0),
         overrides: HashMap::new(),
     };
-    let table = match try!(config.get_table(&key[])) {
+    let table = match try!(config.get_table(&key)) {
         Some((table, _)) => table,
         None => return Ok(ret),
     };
@@ -245,14 +245,14 @@ fn scrape_target_config(config: &Config, triple: &str)
             metadata: Vec::new(),
         };
         let key = format!("{}.{}", key, lib_name);
-        let table = try!(config.get_table(&key[])).unwrap().0;
+        let table = try!(config.get_table(&key)).unwrap().0;
         for (k, _) in table.into_iter() {
             let key = format!("{}.{}", key, k);
-            let (v, path) = try!(config.get_string(&key[])).unwrap();
+            let (v, path) = try!(config.get_string(&key)).unwrap();
             if k == "rustc-flags" {
                 let whence = format!("in `{}` (in {:?})", key, path);
                 let (paths, links) = try!(
-                    BuildOutput::parse_rustc_flags(&v, &whence[])
+                    BuildOutput::parse_rustc_flags(&v, &whence)
                 );
                 output.library_paths.extend(paths.into_iter());
                 output.library_links.extend(links.into_iter());
index ae9d5e54f5829ec2f8916c1c995524e37ccc9c2a..b8b38b4a2fb4625a54617e1d7bc4c44a71bfef56 100644 (file)
@@ -157,7 +157,7 @@ fn global_config(config: &Config) -> CargoResult<CargoNewConfig> {
     let email = try!(config.get_string("cargo-new.email")).map(|s| s.0);
     let vcs = try!(config.get_string("cargo-new.vcs"));
 
-    let vcs = match vcs.as_ref().map(|p| (&p.0[], &p.1)) {
+    let vcs = match vcs.as_ref().map(|p| (&p.0[..], &p.1)) {
         Some(("git", _)) => Some(VersionControl::Git),
         Some(("hg", _)) => Some(VersionControl::Hg),
         Some(("none", _)) => Some(VersionControl::NoVcs),
index 3322732fe58d4d239bc39b8ab20cdea7e38834ea..3d362d449a001ded6585b8b57a7a9bc2212d2154 100644 (file)
@@ -75,14 +75,14 @@ impl Compilation {
     /// See `process`.
     pub fn target_process<T: BytesContainer>(&self, cmd: T, pkg: &Package)
                                      -> CargoResult<CommandPrototype> {
-        let cmd = CString::from_slice(cmd.container_as_bytes());
+        let cmd = try!(CString::new(cmd.container_as_bytes()));
         self.process(CommandType::Target(cmd), pkg)
     }
 
     /// See `process`.
     pub fn host_process<T: BytesContainer>(&self, cmd: T, pkg: &Package)
                                    -> CargoResult<CommandPrototype> {
-        let cmd = CString::from_slice(cmd.container_as_bytes());
+        let cmd = try!(CString::new(cmd.container_as_bytes()));
         self.process(CommandType::Host(cmd), pkg)
     }
 
index f9e562cc8fffec26cf544eb516963b408179b322..6e4431efb9d5c277782181b264b47c9be8d695a2 100644 (file)
@@ -56,7 +56,7 @@ impl<'a, 'b: 'a> Context<'a, 'b> {
                root_pkg: &Package,
                build_config: BuildConfig) -> CargoResult<Context<'a, 'b>> {
         let target = build_config.requested_target.clone();
-        let target = target.as_ref().map(|s| &s[]);
+        let target = target.as_ref().map(|s| &s[..]);
         let (target_dylib, target_exe) = try!(Context::filename_parts(target));
         let (host_dylib, host_exe) = if build_config.requested_target.is_none() {
             (target_dylib.clone(), target_exe.clone())
@@ -358,7 +358,7 @@ impl<'a, 'b: 'a> Context<'a, 'b> {
 
     /// Requested (not actual) target for the build
     pub fn requested_target(&self) -> Option<&str> {
-        self.build_config.requested_target.as_ref().map(|s| &s[])
+        self.build_config.requested_target.as_ref().map(|s| &s[..])
     }
 
     /// Calculate the actual profile to use for a target's compliation.
index 63566ba9f35edd5cb2ac181d848a2b8f8a9cd2e9..2e270e5d8dd316aa8a58f1c4fc1abef2acb67cd5 100644 (file)
@@ -57,7 +57,7 @@ pub fn prepare(pkg: &Package, target: &Target, req: Platform,
         cx.is_relevant_target(t) && !t.profile().is_custom_build()
     }).unwrap_or(target);
     let profile = cx.profile(profile_target);
-    let to_exec = CString::from_slice(to_exec.as_vec());
+    let to_exec = try!(CString::new(to_exec.as_vec()));
     let p = try!(super::process(CommandType::Host(to_exec), pkg, target, cx));
     let mut p = p.env("OUT_DIR", Some(&build_output))
                  .env("CARGO_MANIFEST_DIR", Some(pkg.manifest_path()
index 503cf36a83deb3ce66d90422a3bf41e2a09b1987..1a62d016100dd31d3b3c241f6a498693ad917771 100644 (file)
@@ -406,6 +406,6 @@ pub fn append_current_dir(path: &Path, cwd: &Path) -> CargoResult<()> {
     try!(f.seek(0, old_io::SeekSet));
     try!(f.write_all(cwd.as_vec()));
     try!(f.write_all(&[0]));
-    try!(f.write_all(&contents[]));
+    try!(f.write_all(&contents));
     Ok(())
 }
index f3aea5f0e241f77b48d33b99cd6ef32efb09f885..8c10cba79dc2ceb7d5ce23a620f10c1ba9376655 100644 (file)
@@ -22,7 +22,7 @@ impl<A, R, F: FnOnce(A) -> R> FnBox<A, R> for F {
 
 impl Work {
     pub fn new<F>(f: F) -> Work
-                  where F: FnOnce(Sender<String>) -> CargoResult<()> + Send {
+                  where F: FnOnce(Sender<String>) -> CargoResult<()> + Send + 'static {
         Work { inner: Box::new(f) }
     }
 
index 71cb8aadafcdcca83a846428a06055b418548af0..a83887d45a4362f840038b97b5d71b153317e11c 100644 (file)
@@ -16,7 +16,7 @@ use super::job::Job;
 /// This structure is backed by the `DependencyQueue` type and manages the
 /// actual compilation step of each package. Packages enqueue units of work and
 /// then later on the entire graph is processed and compiled.
-pub struct JobQueue<'a, 'b> {
+pub struct JobQueue<'a> {
     pool: TaskPool,
     queue: DependencyQueue<(&'a PackageId, Stage),
                            (&'a Package, Vec<(Job, Freshness)>)>,
@@ -62,9 +62,9 @@ pub enum Stage {
 
 type Message = (PackageId, Stage, Freshness, CargoResult<()>);
 
-impl<'a, 'b> JobQueue<'a, 'b> {
+impl<'a> JobQueue<'a> {
     pub fn new(resolve: &'a Resolve, packages: &'a PackageSet, jobs: u32)
-               -> JobQueue<'a, 'b> {
+               -> JobQueue<'a> {
         let (tx, rx) = channel();
         JobQueue {
             pool: TaskPool::new(jobs as usize),
index d94168a16934e561fcd67adfff401d7096c4b8ad..60711242a25109033c5409cf988685688ffd9c5c 100644 (file)
@@ -141,7 +141,7 @@ pub fn compile_targets<'a, 'b>(env: &str,
     };
     let host_layout = Layout::new(root, None, dest);
     let target_layout = build_config.requested_target.as_ref().map(|target| {
-        layout::Layout::new(root, Some(&target[]), dest)
+        layout::Layout::new(root, Some(&target), dest)
     });
 
     let mut cx = try!(Context::new(env, resolve, sources, deps, config,
@@ -209,7 +209,7 @@ pub fn compile_targets<'a, 'b>(env: &str,
 fn compile<'a, 'b>(targets: &[&'a Target], pkg: &'a Package,
                    compiled: bool,
                    cx: &mut Context<'a, 'b>,
-                   jobs: &mut JobQueue<'a, 'b>) -> CargoResult<()> {
+                   jobs: &mut JobQueue<'a>) -> CargoResult<()> {
     debug!("compile_pkg; pkg={}", pkg);
     let _p = profile::start(format!("preparing: {}", pkg));
 
@@ -475,7 +475,7 @@ fn add_plugin_deps(rustc: CommandPrototype,
             search_path.push(path.clone());
         }
     }
-    let search_path = try!(join_paths(&search_path[], var));
+    let search_path = try!(join_paths(&search_path, var));
     Ok(rustc.env(var, Some(search_path)))
 }
 
index cc546340fa73c201972c5d69f52ed7c847f58655..054c603d4fbcf105ac88a147fb0b92b74f6b9018 100644 (file)
@@ -127,7 +127,7 @@ impl<'a, 'b> PathSource<'a, 'b> {
 
         let mut ret = Vec::new();
         'outer: for entry in index.iter() {
-            let fname = &entry.path[];
+            let fname = &entry.path[..];
             let file_path = root.join(fname);
 
             // Filter out files outside this package.
index 7185bafe30d809e42959087c20fc2bcc7c858145..155606e48466e8cb63719c074ed1d47769dd470c 100644 (file)
@@ -5,7 +5,7 @@
 //! it to figure out when a dependency should be built.
 
 use std::collections::hash_set::HashSet;
-use std::collections::hash_map::{HashMap, Hasher};
+use std::collections::hash_map::HashMap;
 use std::collections::hash_map::Entry::{Occupied, Vacant};
 use std::hash::Hash;
 
@@ -47,7 +47,7 @@ pub enum Freshness {
 }
 
 /// A trait for discovering the dependencies of a piece of data.
-pub trait Dependency: Hash<Hasher> + Eq + Clone {
+pub trait Dependency: Hash + Eq + Clone {
     type Context;
     fn dependencies(&self, cx: &Self::Context) -> Vec<Self>;
 }
index 5b03a9668f7d403c37e234dfaab90a23603a9a49..6869b347df8e5fbc27dcd25eba35b6d0ebd49dc5 100644 (file)
@@ -1,4 +1,5 @@
 use std::error::{FromError, Error};
+use std::ffi;
 use std::fmt;
 use std::old_io::IoError;
 use std::old_io::process::{ProcessOutput, ProcessExit, ExitStatus, ExitSignal};
@@ -17,7 +18,7 @@ pub type CargoResult<T> = Result<T, Box<CargoError>>;
 // =============================================================================
 // CargoError trait
 
-pub trait CargoError: Error + Send {
+pub trait CargoError: Error + Send + 'static {
     fn is_human(&self) -> bool { false }
     fn cargo_cause(&self) -> Option<&CargoError>{ None }
 }
@@ -58,8 +59,8 @@ impl<'a, T, F> ChainError<T> for F where F: FnOnce() -> CargoResult<T> {
     }
 }
 
-impl<T, E: CargoError> ChainError<T> for Result<T, E> {
-    fn chain_error<E2, C>(self, callback: C) -> CargoResult<T>
+impl<T, E: CargoError + 'static> ChainError<T> for Result<T, E> {
+    fn chain_error<E2: 'static, C>(self, callback: C) -> CargoResult<T>
                          where E2: CargoError, C: FnOnce() -> E2 {
         self.map_err(move |err| {
             Box::new(ChainedError {
@@ -71,7 +72,7 @@ impl<T, E: CargoError> ChainError<T> for Result<T, E> {
 }
 
 impl<T> ChainError<T> for Option<T> {
-    fn chain_error<E, C>(self, callback: C) -> CargoResult<T>
+    fn chain_error<E: 'static, C>(self, callback: C) -> CargoResult<T>
                          where E: CargoError, C: FnOnce() -> E {
         match self {
             Some(t) => Ok(t),
@@ -213,7 +214,7 @@ impl CliError {
         CliError::from_boxed(error, code)
     }
 
-    pub fn from_error<E: CargoError + 'static>(error: E, code: i32) -> CliError {
+    pub fn from_error<E: CargoError>(error: E, code: i32) -> CliError {
         let error = Box::new(error) as Box<CargoError>;
         CliError::from_boxed(error, code)
     }
@@ -252,6 +253,7 @@ from_error! {
     toml::Error,
     url::ParseError,
     toml::DecodeError,
+    ffi::NulError,
 }
 
 impl<E: CargoError> FromError<Human<E>> for Box<CargoError> {
@@ -269,6 +271,7 @@ impl CargoError for toml::Error {}
 impl CargoError for toml::DecodeError {}
 impl CargoError for url::ParseError {}
 impl CargoError for str::Utf8Error {}
+impl CargoError for ffi::NulError {}
 
 // =============================================================================
 // Construction helpers
@@ -335,7 +338,7 @@ pub fn human<S: fmt::Display>(error: S) -> Box<CargoError> {
     })
 }
 
-pub fn caused_human<S: fmt::Display, E: Error + Send>(error: S, cause: E) -> Box<CargoError> {
+pub fn caused_human<S: fmt::Display, E: Error + Send + 'static>(error: S, cause: E) -> Box<CargoError> {
     Box::new(ConcreteCargoError {
         description: error.to_string(),
         detail: None,
index 9f97daa10e5f6d10b01bd74805ae31b92cdc9578..e9cdad6c447beef3e38aabde94104fd080c71982 100644 (file)
@@ -1,7 +1,7 @@
 use std::fmt;
 use std::hash::Hash;
 use std::collections::hash_set::HashSet;
-use std::collections::hash_map::{HashMap, Keys, Hasher};
+use std::collections::hash_map::{HashMap, Keys};
 use std::collections::hash_map::Entry::{Occupied, Vacant};
 use std::collections::hash_set::Iter;
 
@@ -17,7 +17,7 @@ enum Mark {
 pub type Nodes<'a, N> = Keys<'a, N, HashSet<N>>;
 pub type Edges<'a, N> = Iter<'a, N>;
 
-impl<N: Eq + Hash<Hasher> + Clone> Graph<N> {
+impl<N: Eq + Hash + Clone> Graph<N> {
     pub fn new() -> Graph<N> {
         Graph { nodes: HashMap::new() }
     }
@@ -72,7 +72,7 @@ impl<N: Eq + Hash<Hasher> + Clone> Graph<N> {
     }
 }
 
-impl<N: fmt::Display + Eq + Hash<Hasher>> fmt::Debug for Graph<N> {
+impl<N: fmt::Display + Eq + Hash> fmt::Debug for Graph<N> {
     fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
         try!(writeln!(fmt, "Graph {{"));
 
@@ -90,12 +90,12 @@ impl<N: fmt::Display + Eq + Hash<Hasher>> fmt::Debug for Graph<N> {
     }
 }
 
-impl<N: Eq + Hash<Hasher>> PartialEq for Graph<N> {
+impl<N: Eq + Hash> PartialEq for Graph<N> {
     fn eq(&self, other: &Graph<N>) -> bool { self.nodes.eq(&other.nodes) }
 }
-impl<N: Eq + Hash<Hasher>> Eq for Graph<N> {}
+impl<N: Eq + Hash> Eq for Graph<N> {}
 
-impl<N: Eq + Hash<Hasher> + Clone> Clone for Graph<N> {
+impl<N: Eq + Hash + Clone> Clone for Graph<N> {
     fn clone(&self) -> Graph<N> {
         Graph { nodes: self.nodes.clone() }
     }
index 3e8d9629a55f66ea07591a7f4b07b6f7b3ab262f..f3479666ddb8ffeca4d6b5888c549ad51917a1db 100644 (file)
@@ -8,7 +8,7 @@ pub fn to_hex(num: u64) -> String {
     writer.to_hex()
 }
 
-pub fn short_hash<H: Hash<SipHasher>>(hashable: &H) -> String {
+pub fn short_hash<H: Hash>(hashable: &H) -> String {
     let mut hasher = SipHasher::new_with_keys(0, 0);
     hashable.hash(&mut hasher);
     to_hex(hasher.finish())
index 337644b3b77c3f63b9bdc5b92e904fb65cc23173..1bb7d8e305af2fe10efb9f89fed807a8e1a0b56a 100644 (file)
@@ -48,7 +48,7 @@ fn test_lev_distance() {
     for c in range(0u32, MAX as u32)
              .filter_map(|i| from_u32(i))
              .map(|i| i.to_string()) {
-        assert_eq!(lev_distance(&c[], &c[]), 0);
+        assert_eq!(lev_distance(&c, &c), 0);
     }
 
     let a = "\nMäry häd ä little lämb\n\nLittle lämb\n";
index 290b65aab4896f4176dd8b18a0f31fd89957f1c9..207bea3b3aabf570a628cfd988239fc548cd894a 100644 (file)
@@ -115,7 +115,7 @@ impl ProcessBuilder {
         let mut program = format!("{}", String::from_utf8_lossy(self.program.as_bytes()));
         for arg in self.args.iter() {
             program.push(' ');
-            program.push_str(&format!("{}", String::from_utf8_lossy(arg.as_bytes()))[]);
+            program.push_str(&format!("{}", String::from_utf8_lossy(arg.as_bytes())));
         }
         program
     }
index 17cae77fb6c7718bdbe3086d45d10c446c4c0e34..d47abca81bb0002bde3c0d792f8692c42e1b45bc 100644 (file)
@@ -1 +1 @@
-2015-02-12
+2015-02-21
index 7c10756ae891951855c7a023ff3f07537570912a..de7972d8960f39cbefce76b9129ba5f6f6374690 100644 (file)
@@ -359,12 +359,12 @@ fn lines_match(expected: &str, mut actual: &str) -> bool {
     actual.len() == 0 || expected.ends_with("[..]")
 }
 
-struct ZipAll<T, I1, I2> {
+struct ZipAll<I1: Iterator, I2: Iterator> {
     first: I1,
     second: I2,
 }
 
-impl<T, I1: Iterator<Item=T>, I2: Iterator<Item=T>> Iterator for ZipAll<T, I1, I2> {
+impl<T, I1: Iterator<Item=T>, I2: Iterator<Item=T>> Iterator for ZipAll<I1, I2> {
     type Item = (Option<T>, Option<T>);
     fn next(&mut self) -> Option<(Option<T>, Option<T>)> {
         let first = self.first.next();
@@ -377,10 +377,10 @@ impl<T, I1: Iterator<Item=T>, I2: Iterator<Item=T>> Iterator for ZipAll<T, I1, I
     }
 }
 
-fn zip_all<T, I1: Iterator<Item=T>, I2: Iterator<Item=T>>(a: I1, b: I2) -> ZipAll<T, I1, I2> {
+fn zip_all<T, I1: Iterator<Item=T>, I2: Iterator<Item=T>>(a: I1, b: I2) -> ZipAll<I1, I2> {
     ZipAll {
         first: a,
-        second: b
+        second: b,
     }
 }
 
index 646db4fd8824738244785ba8f2c5ac6b497640b1..1c7705167a068cb152ba2817e402fc5adf682312 100644 (file)
@@ -1,7 +1,7 @@
 use std::collections::HashSet;
 use std::old_io::net::tcp::TcpAcceptor;
 use std::old_io::{TcpListener, Listener, Acceptor, BufferedStream};
-use std::thread::Thread;
+use std::thread;
 use git2;
 
 use support::{project, execs, UPDATING};
@@ -38,7 +38,7 @@ test!(http_auth_offered {
            .collect()
     }
 
-    let t = Thread::scoped(move|| {
+    let t = thread::spawn(move|| {
         let mut s = BufferedStream::new(a.accept().unwrap());
         let req = headers(&mut s);
         s.write_all(b"\
@@ -130,7 +130,7 @@ test!(https_something_happens {
     let mut a = listener.listen().unwrap();
     let a2 = a.clone();
     let _c = Closer { a: a2 };
-    let t = Thread::scoped(move|| {
+    let t = thread::spawn(move|| {
         drop(a.accept().unwrap());
     });
 
@@ -180,7 +180,7 @@ test!(ssh_something_happens {
     let mut a = listener.listen().unwrap();
     let a2 = a.clone();
     let _c = Closer { a: a2 };
-    let t = Thread::scoped(move|| {
+    let t = thread::spawn(move|| {
         drop(a.accept().unwrap());
     });
 
index 11a152fbb1af0e5cc6d1e8b5b62743f8f2bb7bf6..79983455250b6e369dbf0879f24d8cb91cd8a6c9 100644 (file)
@@ -1675,7 +1675,7 @@ test!(dont_require_submodules_are_checked_out {
     git2::Repository::init(&project.root()).unwrap();
     let url = path2url(git1.root()).to_string();
     let dst = paths::home().join("foo");
-    git2::Repository::clone(&url[], &dst).unwrap();
+    git2::Repository::clone(&url, &dst).unwrap();
 
     assert_that(git1.process(cargo_dir().join("cargo")).arg("build").arg("-v")
                     .cwd(dst),
index 1ab15c83e99d546bef2bed46740bb64339d711b9..18c5856b92833afa77c3a15d51cdac98f1545aef 100644 (file)
@@ -1,5 +1,4 @@
-#![deny(warnings)]
-#![feature(collections, core, io, os, path, rustc_private, std_misc, env)]
+#![feature(collections, core, io, old_io, os, old_path, rustc_private, std_misc, env)]
 
 extern crate cargo;
 extern crate flate2;